package com.bk.mapper;

import com.bk.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    /**
     * 根据用户名查询用户所有信息
     * @param username
     * @return
     */
    @Select("select * from user where username = #{username}")
    User getByUsername(String username);
    /**
     * 根据id查看用户名
     * @param userId
     * @return
     */
    @Select("select username from user where id=#{userId}")
    String getUsername(Long userId);


    /**
     * 根据userid查username
     * @param userId
     * @return
     */
    @Select("select username from user where id=#{userId}")
    String getUserNameById(Long userId);

}
